﻿using GlobalStringFormatter;
using Samples.DependencyInjectedConsole.Accounts;

namespace Samples.DependencyInjectedConsole.GStrings
{
    public class EuroGString : GString<Currency, double>
    {
        // Unless your machine is set to the European culture page, it won't be possible
        // to see the Euro symbol in the console. Thus, I'm using E to substitute.
        public EuroGString()
        {
            Formatters.Add(v => v < 1000, v => string.Format("{0:C} E", v));
            Formatters.Add(v => v >= 1000 && v < 1000000, v => string.Format("{0:C}k E", v / 1000));
            Formatters.Add(v => v >= 1000000, v => string.Format("{0:C}m E", v / 1000000));
        }
    }
}
